/***************************************************************************
 *   Copyright (C) 2008 by Eduardo Gurgel Pinho                            *
 *   edgurgel@gmail.com                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

#include "object.h"

#include "material/object_material.h"
#include "material/texture_material.h"
#include "material/color_material.h"
#include "math/vector.h"
#include "math/ray.h"
#include "material/material.h"

namespace Sirat {

namespace Object {

Object::Object(Material::Object_Material* _object_material) : object_material(_object_material) { }

Object::Object() : object_material(new Material::Color_Material()) { }

Object::Object(const Object& _object) {
	object_material = static_cast<Material::Object_Material*>(_object.object_material->clone());
}

Object::~Object() { delete object_material; }

Material::Object_Material* Object::get_material() { return object_material; }

void Object::set_material(Material::Object_Material* _object_material) { object_material = _object_material; }

Object& Object::operator=(const Object& _object) {
	object_material = static_cast<Material::Object_Material*>(_object.object_material->clone());
	return *this;
}

}

}
